package com.slkj.shilixiaoyuanapp.entity.parent;

import com.slkj.shilixiaoyuanapp.R;
import com.slkj.shilixiaoyuanapp.SlxyApplication;

import java.util.List;

/**
 * 作者：何磊 on 2018/10/18 13:21
 * 描述：
 */
public class StudentCheckEntity {
        /**
         * normal : 0
         * leave : 0
         * beLate : 2
         * list : [{"dates":"2018-10-1"},{"dates":"2018-10-2"},{"dates":"2018-10-3"},{"dates":"2018-10-4"},{"dates":"2018-10-5"},{"dates":"2018-10-6"},{"dates":"2018-10-7"},{"dates":"2018-10-8"},{"dates":"2018-10-9"},{"name":"刘钦澜","dates":"2018-10-10","type":2},{"dates":"2018-10-11"},{"dates":"2018-10-12"},{"dates":"2018-10-13"},{"dates":"2018-10-14"},{"dates":"2018-10-15"},{"dates":"2018-10-16"},{"dates":"2018-10-17"},{"name":"刘钦澜","dates":"2018-10-18","type":2},{"dates":"2018-10-19"},{"dates":"2018-10-20"},{"dates":"2018-10-21"},{"dates":"2018-10-22"},{"dates":"2018-10-23"},{"dates":"2018-10-24"},{"dates":"2018-10-25"},{"dates":"2018-10-26"},{"dates":"2018-10-27"},{"dates":"2018-10-28"},{"dates":"2018-10-29"},{"dates":"2018-10-30"},{"dates":"2018-10-31"}]
         */

        private int normal;
        private int leave;
        private int beLate;
        private List<ListBean> list;

        public int getNormal() {
            return normal;
        }

        public void setNormal(int normal) {
            this.normal = normal;
        }

        public int getLeave() {
            return leave;
        }

        public void setLeave(int leave) {
            this.leave = leave;
        }

        public int getBeLate() {
            return beLate;
        }

        public void setBeLate(int beLate) {
            this.beLate = beLate;
        }

        public List<ListBean> getList() {
            return list;
        }

        public void setList(List<ListBean> list) {
            this.list = list;
        }

        public static class ListBean {
            /**
             * dates : 2018-10-1
             * name : 刘钦澜
             * type : 2
             */

            private String dates;
            private String name;
            private int type;

            public String getDates() {
                return dates;
            }

            public void setDates(String dates) {
                this.dates = dates;
            }

            public String getName() {
                return name;
            }

            public void setName(String name) {
                this.name = name;
            }

            public int getType() {
                return type;
            }

            public void setType(int type) {
                this.type = type;
            }
            public String getTypeStr() {
                switch (type){
                    case 0:
                        return "请假";
                    case 1:
                        return "正常";

                    case 2:
                        return "迟到";

                }
                return "";

            }
            public int getTypeColor() {
                switch (type){
                    case 0:
                        return SlxyApplication.getContext().getResources().getColor(R.color.color_yelow) ;
                    case 1:
                        return SlxyApplication.getContext().getResources().getColor(R.color.colorAccent) ;
                    case 2:
                        return SlxyApplication.getContext().getResources().getColor(R.color.color_yc) ;
                }
                return SlxyApplication.getContext().getResources().getColor(R.color.colorAccent) ;

            }

            /**
             * 是否迟到
             * @return
             */
            public boolean isCd(){
                return type==2;
            }
            /**
             * 是否是请假
             * @return
             */
            public boolean isQj(){
                return type==0;
            }
            /**
             * 是否是请假
             * @return
             */
            public boolean isZc(){
                return type==1;
            }
        }
}
